package com.zerox.sbdemo.controller;

import com.zerox.sbdemo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;

@Controller
public class HelloController {

    // @Value("${person.name}")
    // private String name;
    //
    // @Value("${person.birthday}")
    // private String birthday;

    @Autowired
    private Person person;

    @GetMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello "+person.getName()+",出生日期："+ person.getBirthday()+",我的爱好："+ Arrays.toString(person.getHobby().toArray());
    }
}
